package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;
import com.financing.platform.dao.IYouDanAmountDao;
import com.financing.platform.dto.BankCardDTO;
import com.financing.platform.dto.WallettWithdrawDTO;
import com.financing.platform.dto.YouDanAmountDTO;
import com.financing.platform.util.SqlName;
import com.financing.platform.vo.WallettWithdrawVO;


@Repository("youDanAmountDaoImpl")
public class YouDanAmountDaoImpl extends BaseDaoImpl implements IYouDanAmountDao {

	@Override
	public Integer insertYouDanAmount(YouDanAmountDTO youDanAmountDTO) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.insertYouDanAmount,youDanAmountDTO);
	}

	@Override
	public int updateYouDanAmount(YouDanAmountDTO youDanAmount) throws SQLException {
		return this.sqlMapClient.update(SqlName.updateYouDanAmount, youDanAmount);
	}

	@Override
	public YouDanAmountDTO getYouDanAmount(YouDanAmountDTO youDanAmount) throws SQLException {
		return (YouDanAmountDTO) this.sqlMapClient.queryForObject(SqlName.getYouDanAmount, youDanAmount);
	}

	@Override
	public Integer getYouDanWithdrawListCount(WallettWithdrawVO wallettWithdrawVO) throws SQLException {
		return (Integer)this.sqlMapClient.queryForObject(SqlName.getYouDanWithdrawListCount, wallettWithdrawVO);
	}

	@Override
	public List<WallettWithdrawDTO> getYouDanWithdrawList(WallettWithdrawVO wallettWithdrawVO) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.getYouDanWithdrawList, wallettWithdrawVO);
	}

	@Override
	public BankCardDTO queryFaUserBankInfo(WallettWithdrawDTO wallettWithdrawDTO) throws SQLException {
		return (BankCardDTO) this.sqlMapClient.queryForObject(SqlName.queryFaUserBankInfo, wallettWithdrawDTO);
	}

	@Override
	public List<YouDanAmountDTO> getCommonOrderAmountByAssociationId(String id) throws SQLException {
		// TODO Auto-generated method stub
		return this.sqlMapClient.queryForList(SqlName.queryCommonOrderAmountByAssociationId, id);
	}



}
